package net.csdn.business.common.domain.request;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.csdn.business.common.domain.issue.IssueExt;
import net.csdn.business.common.domain.validation.groups.System;
import net.csdn.business.common.enums.IssueEnum;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author likun
 * @date 2022/6/14 17:18
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class IssueUpdateStatusReqDto implements Serializable {
    @NotBlank(message = "issueId 不合法")
    private String issueId;

    @NotNull(message = "status 不能为空")
    @Range(min = 1, max = 2, message = "status 不合法")
    private Integer status;

    @Range(min = 1, max = 2, message = "statusReason 不合法")
    private Integer statusReason = IssueEnum.StatusReasonEnum.CHECKED.getCode();

    /**
     * 关闭支持评论
     */
    private String content;

    private String mdContent;

    @NotBlank(message = "uid 不合法", groups = {System.class})
    private String uid;

    /**
     * {@link net.csdn.business.common.enums.UserTypeEnum}
     */
    private Integer userType;

    private IssueExt ext;

    /**
     * 评论@username列表
     */
    private List<String> commentAts;

    public IssueUpdateStatusReqDto(String uid, Integer userType, String issueId, Integer status, Integer statusReason, IssueExt ext) {
        this.uid = uid;
        this.userType = userType;
        this.issueId = issueId;
        this.status = status;
        this.statusReason = statusReason;
        this.ext = ext;
    }

    private Boolean migrateFlag = false;

    private Date createdDate;

    private Date updatedDate;

    private Date closedDate;
}
